<?php
/**
 * Created by PhpStorm.
 * User: jimmyhsu
 * Date: 2016/10/5
 * Time: 下午3:59
 * 接受用户名或手机号,判断是否存在该用户
 */
include ("conn.php");
$name_or_mobile=$_POST['name'];
$sql="select * from userinfo where name = '$name_or_mobile'";
$result=mysql_query($sql) or die("db error");
if (mysql_num_rows($result) > 0){
    echo "exists";
}else{
    $sql="select * from userinfo where mobile = '$name_or_mobile'";
    $result=mysql_query($sql);
    if (mysql_num_rows($result)>0) {
        echo "exists";
    }else {
        echo "not exist";
    }
}